<div class="bjui-pageHeader" style="background-color: #fefefe; border-bottom: none;">
    <form action="/admin/app/app-version-list" data-toggle="ajaxsearch" id="findglobalform" data-options="{
    validate:false,
    searchDatagrid:$.CurrentNavtab.find('#app-version-list'),

    }">
        <fieldset>
            <legend style="font-weight:normal;">搜索：</legend>
            <div style="margin:0; padding:1px 5px 5px;">
                <span>APP名称:</span>
                <input name="name" size="10">&nbsp;

                <span>APP版本号:</span>
                <input name="version" size="10">&nbsp;

                <div class="btn-group">
                    <button type="submit" class="btn-green" data-icon="search">查询！</button>

                </div>
            </div>
        </fieldset>
    </form>
</div>
<div class="bjui-pageContent">
    <table class="table table-bordered" id="app-version-list" data-toggle="datagrid" data-options="{
    height: '100%',

    fullGrid:true,
    filterThead:false,
    fieldSortable:false,
    columnMenu:false,
    local: 'remote',
    dataUrl:'/admin/app/app-version-list',
    editUrl:'/admin/app/app-version-list',

    linenumberAll: true,

    showToolbar:true,
    toolbarCustom:toolbar,
}">
        <thead>
        <th data-options="{name:'name',align:'center',width:70}">APP名称</th>
        <th data-options="{name:'version',align:'center',width:70}">版本号</th>

        <th data-options="{name:'is_force_update',align:'center',width:70,items:[{'0':'否'},{'1':'是'}]}">是否强制更新</th>
        <th data-options="{name:'is_current_version',align:'center',width:70,items:[{'0':'否'},{'1':'是'}]}">是否当前版本</th>
        <th data-options="{name:'platform',align:'center',width:70,items:[{'0':'未知'},{'1':'android'},{'2':'ios'}]}">平台</th>
        <th data-options="{align:'center',render:operationColumn}">操作</th>
        </thead>
    </table>
</div>
<script>
    function operationColumn(value, data) {
        var html='<button type="button" class="btn btn-green" data-toggle="dialog" data-options="{id:\'app-version-edit\', url:\'/admin/app/app-version-edit\', mask:true, width:900, height:500, title:\'编辑APP版本信息\', data:{id:' + data.id + '}}"><i class="fa fa-edit"></i>编辑</button>';

            html += '<button type="button" class="btn btn-green" data-toggle="dialog" data-options="{id:\'app-version-detai\', url:\'/admin/app/app-version-detail\', mask:true, width:900, height:500, title:\'查看APP版本信息详情\', data:{id:' + data.id + '}}"><i class="fa fa-edit"></i>查看详情</button>';



//        html += '<button type="button" class="btn btn-red bjui-datagrid-btn delete"  data-toggle="del.datagrid.tr" ><i class="fa fa-remove"></i>删除</button>';
        return html;
    }

    function toolbar(value, data) {
        var html='<button type="button" class="btn btn-blue" data-toggle="dialog" data-options="{id:\'app-version-add\', url:\'/admin/app/app-version-add\', mask:true, width:900, height:500, title:\'添加APP版本\',}"><i class="fa fa-plus"></i>添加</button>';
        return html;
    }


</script>